package com.zcxy360.sandtable.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zcxy360.sandtable.exception.MyException;

@Transactional
@Service
public class TestService {

	public void check(Integer i) {
		if(i == null) {
			throw new MyException("i 不能为空");
		}
		if(i == 0) {
			throw new MyException("i 不能为0");
		}
		try {
			i = i/(i-1);
		}catch(Exception e) {
			throw new MyException("除法错误");
		}
		throw new NullPointerException("空指针异常...........");
	}

}
